package cn.dac.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("exception")
public class TestController {
    @GetMapping("index")
    @ResponseBody
    public String index(){
        //制造一个异常 自动跳转到5xx.html
        int a = 2/0;
        return "index";
    }

}
